<?php

/**
 * return json per ajax request
 */
function link_helper_json() {
  if(isset($_POST['uri']) && !empty($_POST['uri'])) {
    $uri = $_POST['uri'];

    $tags = link_helper_find_tags($uri);
    $tags['html'] = theme('link_helper_og_data', array('og_data' => $tags));
    drupal_json_output($tags);
    drupal_exit();
  }

  drupal_access_denied();
}
